package copyengine.sceneAndDialog
{
    import copyengine.utils.GeneralUtils;
    import copyengine.utils.ICEDispose;

    /**
     * 类似于显示树结构的Component结构体, 就像DisplayObjectContainer
     *
     * 用于Dialog和Scene 进行子组件的维护
     *
     * 1`  CETreeStructureComponent 只是结构上的存在 不是显示对象 也不一定含有显示对象
     * 2`  实现了Dispose函数
     */
    public class CETreeStructureComponent implements ICEDispose
    {
        protected var mAllSubComponentVector:Vector.<CETreeStructureComponent>;

        public function CETreeStructureComponent() {
            mAllSubComponentVector = new Vector.<CETreeStructureComponent>();
        }

        public function addSubComponent(_component:CETreeStructureComponent):void {
            GeneralUtils.addElementToArrayOrVector(_component, mAllSubComponentVector);
        }

        public function removeSubComponent(_component:CETreeStructureComponent):void {
            GeneralUtils.removeElementFromArrayOrVector(_component, mAllSubComponentVector);
        }

        public function dispose():void {
            GeneralUtils.disposeAllDisposeAbleObjectInArrayOrVector(mAllSubComponentVector);
        }

    }
}
